import { createApp } from 'vue'
import { Vue3Mq, MqResponsive } from 'vue3-mq'
import App from './App.vue'

import router, { setupRouter } from '/@/router'
import { setupComponents } from '/@/components/common'
import { setupVant } from '/@/components/vant'

import 'ress/dist/ress.min.css'
// import '@arco-design/web-vue/dist/arco.min.css'
import '/@/assets/style/app.less'

;(async () => {
  const app = createApp(App)

  // register mq
  app.use(Vue3Mq, {
    defaultBreakpoint: 'md',
    breakpoints: {
      xs: 0,
      sm: 576,
      md: 768,
      lg: 992,
      xl: 1200,
      xxl: 1600
    }
  })
  app.component('MqResponsive', MqResponsive)

  // register common comps
  setupComponents(app)
  setupVant(app)

  // register router
  setupRouter(app)

  await router.isReady()

  app.mount('#app')

})()
